<extend name="Public/layout"/>

<block name="style">
    <style type="text/css">
        @media (min-width: 992px) {
            .form select,
            .form textarea,
            .form input[type=text],
            .form input[type=password],
            .form .token-input-list{
                width: 50% !important;
                max-width: 600px;
            }
        }
    </style>
</block>

<block name="body">
    <div class="row">
        <div class="col-xs-12">    
            <if condition="$action eq 'sendOut'"> 
                <form action="__SELF__" method="post" class="form">
                    <div class="form-group">
                        <div class="form-group">
                            <label class="item-label">快递名称<span class="check-tips">（快递名称）</span></label>
                            <div class="controls">
                                <input type="text" class="form-control" name="express_name" value="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="item-label">快递单号<span class="check-tips">（快递单号）</span></label>
                            <div class="controls">
                                <input type="text" class="form-control" name="express_no" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="hidden" name="id" value="{$order.id|default=''}">
                            <button class="btn btn-primary submit ajax-post" type="submit" target-form="form">确 定</button>
                            <button class="btn return" onclick="javascript:history.back(-1);
                                    return false;">返 回</button>
                        </div>
                </form>

                <elseif condition="$name eq 2"/>
                <else /> 

            </if>
            <div class="panel panel-default">
                <div class="panel-heading">订单信息</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-body">
                            <div class="row">
                                <h4 class="form-section">&nbsp;&nbsp;&nbsp;基本信息</h4>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">订单编号:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static">{$order.no}</p>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">总金额:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static">{$order.total}</p>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <!--/row-->
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">下单时间:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static">{$order.create_time|date="Y-m-d h:i",###}</p>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">备注:</label>
                                        <div class="col-md-9">
                                            <p class="form-control-static">{$order.remark}</p>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>

                            <!--/row-->                
                            <div class="row">
                                <div class="col-md-12">
                                    <h4 class="form-section">产品信息</h4>
                                    <empty name="goods">
                                        没有产品
                                        <else/>
                                        <table class="table">
                                            <thead>
                                                <tr>
                                                    <th>产品名称</th>
                                                    <th>产品价格</th>
                                                    <th>产品封面</th>
                                                    <th>购买数量</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <volist name="goods" id="data">
                                                <tr>
                                                    <th scope="row">{$data.title}</th>
                                                    <td>{$data.price}</td>
                                                    <td><img style="width:30px;" src="{$data.cover|get_cover}" /></td>
                                                    <td>{$data.count}</td>
                                                </tr>
                                            </volist>                    
                                            </tbody>
                                        </table>
                                    </empty>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <h4 class="form-section">分佣信息</h4>
                                    <empty name="commissions">
                                        没有分佣信息
                                        <else/>
                                        <table class="table">
                                            <thead>
                                                <tr>
                                                    <th>分佣者</th>
                                                    <th>分佣金额</th>
                                                    <th>分佣比例(每100份)</th>
                                                    <th>状态</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <volist name="commissions" id="data">
                                                <tr>
                                                    <th scope="row">{$data.userid}</th>
                                                    <td>{$data.commission}</td>
                                                    <td>{$data.commission_scale}</td>
                                                    <td>
                                                <if condition="$data.status eq 1">
                                                    已发放
                                                    <else/>
                                                    未发放
                                                </if>
                                                </td>
                                                </tr>
                                            </volist>                    
                                            </tbody>
                                        </table>
                                    </empty>
                                </div>
                            </div>

                        </div>
                    </form>

                </div>
            </div>

        </div>
    </div>
</block>

